package com.niyue.sandbox.uclock.core;

import javax.swing.JFrame;

import org.apache.log4j.Logger;

import com.niyue.sandbox.uclock.clockr.ClockrFace;
import com.niyue.sandbox.uclock.cmdclock.CmdClock;
import com.niyue.sandbox.uclock.guiclock.GuiClock;

public class MainTimer extends AbstractTimer {
	private static Logger logger=Logger.getLogger(MainTimer.class);
	private static int span=1000;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		MainTimer timer=new MainTimer();
		timer.register(new CmdClock());
		ClockrFace clockFace = new ClockrFace();
		timer.register(clockFace);
		timer.regiesterFactory(new SecondTickerEventFactory());
		while(true){
			timer.notifyClock();
			try {
				Thread.sleep(span);
			} catch (InterruptedException e) {
				logger.error("An error occured in the applicatioin. "+e.getMessage());
			}
		}
	}
}
